﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace Rsa.Security {
    public class RsaMembershipUser : MembershipUser {
        #region "Public Properties"
        public string MembershipProvider;
        public int UsuarioId { get; set; }
        public string Username { get; set; }
        public string Nombre { get; set; }
        public string Apellidos { get; set; }
        public override string Email {get; set;}
        public int Sexo { get; set; }
        public DateTime FechaNacimiento { get; set; }
        #endregion

        #region "Constructors"
        public RsaMembershipUser(string pUserName)
            : base("Rsa.Security.RsaMembershipProvider", pUserName, pUserName.GetHashCode(), pUserName, "", "", false, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now) {
            this.Username = pUserName;
        }
        public RsaMembershipUser(string pMembershipProvider, int pUsuarioId, string pUserName) {
            if (string.IsNullOrEmpty(pMembershipProvider))
                throw new ArgumentException("Membership Provider no puede ser nulo.");

            if (string.IsNullOrEmpty(pUserName))
                throw new ArgumentException("Username no puede ser nulo.");

            this.MembershipProvider = pMembershipProvider;
            this.UsuarioId = pUsuarioId;
            this.Username = pUserName;
        }
        public RsaMembershipUser(string pMembershipProvider
                                 , int pUsuarioId
                                 , string pUsername
                                 , string pNombre
                                 , string pApellidos
                                 , string pEmail
                                 , int pSexo
                                 , DateTime pFechaNacimiento)
            : this(pMembershipProvider, pUsuarioId, pUsername) {

            this.Nombre = pNombre;
            this.Apellidos = pApellidos;
            this.Email = pEmail;
            this.Sexo = pSexo;
        }
        #endregion

        #region "Public Methods"
        public override bool ChangePassword(string oldPassword, string newPassword) {
            return false;
        }
        public override string GetPassword() {
            return string.Empty;
        }
        public override string GetPassword(string passwordAnswer) {
            return string.Empty;
        }
        #endregion
    }
}